package cn.huiyunche.base.service.enums;

/**
 * The enum D waybill status enum.
 */
public enum DWaybillStatusEnum {

    /**
     * Abandoned d waybill status enum.
     */
    ABANDONED(-10, "废弃"),

    /**
     * Save d waybill status enum.
     */
    SAVE(0, "未安排订单"),
    /**
     * Publish d waybill status enum.
     */
    PUBLISH(1, "已发布"),
    /**
     * Departure d waybill status enum.
     */
    DEPARTURE(5, "待发车"),
    /**
     * Intransit d waybill status enum.
     */
    INTRANSIT(10, "在途"),
    /**
     * Deal car d waybill status enum.
     */
    DEAL_CAR(20, "已交车"),
    /**
     * Completed d waybill status enum.
     */
    COMPLETED(30, "已完成"),

    /**
     * Exception confirm d waybill status enum.
     */
    EXCEPTION_CONFIRM(40, "未回单"),

    /**
     * Cancel d waybill status enum.
     */
    CANCEL(90, "取消"),

    /**
     * Failure d waybill status enum.
     */
    FAILURE(100, "派单失败");

    private final int value;
    private final String text;

    DWaybillStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    /**
     * Gets value.
     *
     * @return the value
     */
    public int getValue() {
        return value;
    }

    /**
     * Gets text.
     *
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     * Get by value d waybill status enum.
     *
     * @param value the value
     * @return the d waybill status enum
     */
    public static DWaybillStatusEnum getByValue(int value) {
        for (DWaybillStatusEnum temp : DWaybillStatusEnum.values()) {
            if (temp.getValue() == value) {
                return temp;
            }
        }
        return null;
    }
}
